import request from '@/utils/request'

// 列表
export const GetListAPI = params => {
    return request({
        url: '/production/degreas-document/list',
        method: 'GET',
        params
    })
}

// 新增
export const AddDataAPI = data => {
    return request({
        url: '/production/degreas-document/add',
        method: 'POST',
        data
    })
}

// 修改
export const EditDataAPI = data => {
    return request({
        url: '/production/degreas-document/updateDegreas',
        method: 'PUT',
        data
    })
}

// 上线
export const OnLineAPI = params => {
    return request({
        url: '/production/degreas-document/onLine/' + params,
        method: 'GET'
    })
}

// 停产
export const StopAPI = params => {
    return request({
        url: '/production/degreas-document/stop/' + params,
        method: 'GET'
    })
}

// 关结
export const CloseAPI = data => {
    return request({
        url: '/production/degreas-document/close',
        method: 'POST',
        data
    })
}

// 删除
export const DelDataAPI = data => {
    return request({
        url: '/production/degreas-document/deleteDegreasDocument/' + data,
        method: 'DELETE'
    })
}

// 查看
export const GetViewAPI = data => {
    return request({
        url: '/production/degreas-document/queryDegreasDocument/' + data,
        method: 'GET'
    })
}

// 获取脱脂线别
export const GetDegreasLineAPI = data => {
    return request({
        url: '/system/modeling/getDegreasLine',
        method: 'GET'
    })
}

// 获取对应bom物料明细
export const GetHalfDataAPI = params => {
    return request({
        url: '/production/degreas-document/queryBom',
        method: 'GET',
        params
    })
}

// 获取脱脂车间
export const GetDegreasShopModelingAPI = params => {
    return request({
        url: '/system/modeling/getDegreasShopModeling',
        method: 'GET'
    })
}

// 根据线别编码和开工时间查询预计工时
export const hoursOnById = params => {
    return request({
        url: '/system/modeling/getDegreasShopModeling',
        method: 'GET'
    })
}

// 新增时获取预计完工时间和预计工时
export const GetTimeAndWorkHoursAPI = data => {
    return request({
        url: '/production/degreas-document/getTimeAndWorkHours',
        method: 'POST',
        data
    })
}

// 获取bom一级列表
export const GetOneLevelListAPI = params => {
    return request({
        url: '/system/newBom/getOneLevelList',
        method: 'GET',
        params
    })
}

// 获取bom明细
export const GetDetailInventoryAPI = params => {
    return request({
        url: '/system/newBom/detailInventory',
        method: 'GET',
        params
    })
}